package com.hzhr.iot.device.controller;

import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.annotation.Author;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.device.controller.base.BaseController;
import com.hzhr.iot.device.model.collectDevice.CollectDeviceGetModel;
import com.hzhr.iot.device.model.collectDeviceQuickquery.CollectDeviceQuickqueryModel;
import com.hzhr.iot.device.model.collectDeviceQuickquery.MeterPlan_workOrderlistModel;
import com.hzhr.iot.device.service.CollectDeviceQuickqueryService;
import com.hzhr.iot.device.service.CollectDeviceService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;
import java.util.Map;

@Api(tags = "CollectDeviceQuickquery", description = "采集设备快速查询")
@RestController
@RequestMapping(value = "")
public class CollectDeviceQuickqueryController extends BaseController {

    @Autowired
    CollectDeviceQuickqueryService collectDeviceQuickqueryService;


    //region /v3/collect-device-quickquerys GET
    //region swagger响应码 : getQuick
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : getQuick
    @ApiOperation(value="查询采集设备", notes="查询采集设备  \n简介 : 快速查询采集设备（个性化定制方法，专为提升速度）  \n",produces = "application/json")
    //endregion
    //region swagger参数 : getQuick
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "equal_collectTime", value = "CollectDeviceQuickqueryItemModel.currentTm处于#{equal_collectTime}所在的那一天内",required = false, dataType = "string", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_equal_collectTime", value = "CollectDeviceQuickqueryItemModel.currentTm处于#{equal_collectTime}所在的那一天内",required = false, dataType = "string", paramType = "query"),

    })
    //endregion
    //region 请求 : getQuick
    @RequestMapping(value = "/v3/collect-device-quickquerys", method = RequestMethod.POST)
    //endregion
    @Author
    public ResponseEntity<CollectDeviceQuickqueryModel> getQuick(@RequestParam @ApiIgnore Map<String, Object> query, @RequestBody MeterPlan_workOrderlistModel body) throws ServiceException {
        CollectDeviceQuickqueryModel responseBody = collectDeviceQuickqueryService.getQuick(initHeader(), query,body);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
    }
    //endregion
}












































































































































































































































































































































































































































































































































































































































































